package com.viviet.coreservices.ewallet;

import com.viviet.sentMT.MessageOut;
import com.viviet.sentMT.viviet_sent_mt;

import junit.framework.TestCase;


public class Test extends TestCase{
	
	public void testSendingMessage() {
		viviet_sent_mt sent=new viviet_sent_mt();
		MessageOut out =sent.sentMT("84936376736", "test mt");
		System.out.println("return "+out);
	}
	
	// OK
//	<input>	<service>VFSUB</service>	<verify_password>	<login_id>Mobile number</login_id>	<login_pass>Password</login_pass>	</verify_password>	</input>
	public void testLogin() {
		String messageXML = "<input>	<service>VFSUB</service>	<verify_password>	<login_id>0938051190</login_id>	<login_pass>123456</login_pass>	</verify_password>	</input>";
//		String messageXML = "<input> <service>VerifyPassword</service> <verify_password> <login_id> 0938051190 </login_id> <login_pass> 123456 </login_pass> </verify_password> </input>";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callService("0938051190", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	// OK
	public void testGetBalance() {
		String messageXML = "<input><service>BLIQ</service></input>";
//		String messageXML = "<input>    <service>CT</service>    <funds_transfer>        <debit>1000000214001</debit>        <credit>0983223623</credit>        <amount>2900000</amount>        <description>ct tra no</description>        <charge></charge>    </funds_transfer></input>";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callService("0938051190", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	//OK
	public void testTransferMoney () {
		String messageXML = "<input>    <service>CT</service>    <funds_transfer>        <debit>1000008522001</debit>        <credit>0938051190</credit>        <amount>10000</amount>        <description>ct tra no</description>        <charge></charge>    </funds_transfer></input>";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callService("0906021140", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	// OK
	public void confirmTransfer () {
		String messageXML = "<input>    <service>DY</service>    <otp>7193866</otp></input>";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callService("0906021140", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	// OK
	public void testGetTransactionInfo() {
		String messageXML = "<input><service>ACIQ</service><inquirynumber>5</inquirynumber></input>";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callService("0938051190", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	//OK (Not ready on new version)
	public void testChangePassword() {
		String messageXML = "<input> <service>MK</service> <change_password> <old_pass> 654321 </old_pass> <new_pass> 123456 </new_pass> </change_password> </input>";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callService("0938051190", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	
	//OK 
	public void testChangePasswordSMS() {
		String messageXML = "VV MK 123456 654321";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callServiceSMS("0938051190", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	//OK
	public void testGetBalanceSMS() {
		
		String messageXML = "VV SD";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callServiceSMS("0938051190", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	//OK
	public void testTransferMoneySMS () {
		String messageXML = "VV CT 100000 0906021140";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callServiceSMS("0938051190", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	// OK
	public void confirmTransferSMS() {
		String messageXML = "VV DongY 7F4D4A98AC24BB6B6E99B";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callServiceSMS("0938051190", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	//OK
	public void testGetTransactionInfoSMS() {
		String messageXML = "VV SK";
		EWalletWSCaller ws = new EWalletWSCaller();
		try {
			String retValue = ws.callServiceSMS("0938051190", messageXML);
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
